CREATE TABLE [dbo].[TTRENP_ANUL]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_UNID_CONC] [dbo].[TD_VC_003] NOT NULL,
[CO_PROV] [dbo].[TD_VC_020] NOT NULL,
[NU_RENO] [dbo].[TD_VC_008] NOT NULL,
[FE_RENO] [dbo].[TD_DT_001] NOT NULL,
[FE_ANUL] [dbo].[TD_DT_001] NOT NULL,
[CO_TIPO_OPER] [dbo].[TD_VC_003] NOT NULL,
[ST_CONT] [dbo].[TD_VC_001_INTE] NOT NULL CONSTRAINT [DF__TTRENP_AN__ST_CO__6E814571] DEFAULT ('N'),
[NU_PROC] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TTRENP_AN__NU_PR__70698DE3] DEFAULT ((0)),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTRENP_AN__CO_US__715DB21C] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTRENP_AN__FE_US__7251D655] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TTRENP_AN__CO_US__7345FA8E] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTRENP_AN__FE_US__743A1EC7] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTRENP_ANUL] WITH NOCHECK ADD CONSTRAINT [CK__TTRENP_AN__ST_CO__6F7569AA] CHECK NOT FOR REPLICATION (([ST_CONT]='P' OR [ST_CONT]='N'))
GO
ALTER TABLE [dbo].[TTRENP_ANUL] ADD CONSTRAINT [PK__TTRENP_A__15EA2023793ECB06] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_UNID_CONC], [CO_PROV], [NU_RENO], [FE_RENO]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTRENP_ANUL] ADD CONSTRAINT [FK__TTRENP_ANUL__6A518D31] FOREIGN KEY ([CO_EMPR], [CO_TIPO_OPER]) REFERENCES [dbo].[TTTIPO_OPER] ([CO_EMPR], [CO_TIPO_OPER])
GO
ALTER TABLE [dbo].[TTRENP_ANUL] ADD CONSTRAINT [FK__TTRENP_ANUL__695D68F8] FOREIGN KEY ([CO_EMPR], [CO_UNID_CONC], [CO_PROV], [NU_RENO], [FE_RENO]) REFERENCES [dbo].[TCRENO_PROV] ([CO_EMPR], [CO_UNID_CONC], [CO_PROV], [NU_RENO], [FE_RENO])
GO
